
/**
 * @name 小于10的数添加0
 * @param num 数字
 * @returns number
 */
export const addZero = (num: number) => {
  return (num < 10) ? '0' + num : num
}
/**
 * @name 分割日期
 * @param date 日期
 * @returns Record<string, string>
 */
export const getDate = (date:string) => {
  if (!date) return { year: '', date: '' }
  let arr = date.split(' ');
  let arr2 = arr[0].split('-')
  return {
    year: arr2[0], date: `${arr2[1]}-${arr2[2]}`
  }
}